#!/bin/sh -e

export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
export GOFLAGS="$GOFLAGS -buildmode=pie -trimpath -ldflags=-linkmode=external -mod=vendor -modcacherw"

go build

install -Dm755 croc "$1/usr/bin/croc"
